<?php

class Zend_View_Helper_ExpressTotal{
	
	public function expressTotal($weight,$first_weight,$addition_weight,$fuel_surcharge,$price,$express_rate=true){

		if($express_rate){
		
			$rate=EXPRESS_RATE;
			
		}else{
			
			$rate=1;
			
		}
		
		if($weight<=21&&$weight>0){
		
			return ($first_weight+ceil(($weight-0.5)/0.5)*$addition_weight)*$fuel_surcharge*$rate;
			
		}else if($weight>21){

			return ceil($weight)*$price*$fuel_surcharge*$rate;
			
		}
		
		return 0;
		
	}

}

